---
layout: m1x_soap
title: Inventory Item Update
---

<h2><a name="cataloginventory_stock_item.update-Module%3AMageCatalogInventory"></a>Module: Mage_CatalogInventory</h2>


<h4><a name="cataloginventory_stock_item.update-Resource%3Acataloginventorystockitem"></a>Resource: cataloginventory_stock_item</h4>

<p><b>Aliases</b>:</p>
<ul>
	<li>product_stock</li>
</ul>


<h5><a name="cataloginventory_stock_item.update-Method%3A"></a>Method:</h5>

<ul>
	<li>cataloginventory_stock_item.update (SOAP V1)</li>
	<li>catalogInventoryStockItemUpdate (SOAP V2)</li>
</ul>


<p>Allows you to update the required product stock data.</p>

<p><b>Aliases</b>:</p>
<ul>
	<li>product_stock.update</li>
</ul>



<p><b>Arguments</b>:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId <br class="atl-forced-newline" /> </td>
<td> Session ID </td>
</tr>
<tr>
<td> string </td>
<td> product\productId <br class="atl-forced-newline" /> </td>
<td> Product ID or SKU </td>
</tr>
<tr>
<td> array </td>
<td> data <br class="atl-forced-newline" /> </td>
<td> Array of catalogInventoryStockItemUpdateEntity </td>
</tr>
</tbody></table>


<p><b>Returns</b>:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> int </td>
<td> result </td>
<td> Result of stock item updating </td>
</tr>
</tbody></table>


<p>The <b>catalogInventoryStockItemUpdateEntity</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> qty <br class="atl-forced-newline" /> </td>
<td> Quantity of items to be updated </td>
</tr>
<tr>
<td> int </td>
<td> is_in_stock <br class="atl-forced-newline" /> </td>
<td> Defines whether the item is in stock </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> manage_stock <br class="atl-forced-newline" /> </td>
<td> Manage stock flag </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> use_config_manage_stock <br class="atl-forced-newline" /> </td>
<td> Use config manage stock </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> min_qty <br class="atl-forced-newline" /> </td>
<td> Minimum quantity for items to be in stock </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> use_config_min_qty <br class="atl-forced-newline" /> </td>
<td> Use config settings flag (value defined in the Inventory System Configuration) </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> min_sale_qty <br class="atl-forced-newline" /> </td>
<td> Minimum quantity allowed in the shopping cart </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> use_config_min_sale_qty <br class="atl-forced-newline" /> </td>
<td> Use config settings flag </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> max_sale_qty <br class="atl-forced-newline" /> </td>
<td> Maximum quantity allowed in the shopping cart </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> use_config_max_sale_qty <br class="atl-forced-newline" /> </td>
<td> Use config settings flag </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> is_qty_decimal <br class="atl-forced-newline" /> </td>
<td> Defines whether the quantity is decimal </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> backorders <br class="atl-forced-newline" /> </td>
<td> Backorders status </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> use_config_backorders <br class="atl-forced-newline" /> </td>
<td> Use config settings flag (for backorders) </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> notify_stock_qty <br class="atl-forced-newline" /> </td>
<td> Stock quantity below which a notification will appear </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> use_config_notify_stock_qty <br class="atl-forced-newline" /> </td>
<td> Use config settings flag (for stock quantity) </td>
</tr>
</tbody></table>


<h4><a name="cataloginventory_stock_item.update-Examples"></a>Examples</h4>

<h5><a name="cataloginventory_stock_item.update-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If somestuff requires api authentification,
// then get a session token
$session = $client-&gt;login('apiUser', 'apiKey');

$productId = '1';
$stockItemData = array(
    'qty' =&gt; '100',
    'is_in_stock ' =&gt; 1,
    'manage_stock ' =&gt; 1,
    'use_config_manage_stock' =&gt; 0,
    'min_qty' =&gt; 2,
    'use_config_min_qty ' =&gt; 0,
    'min_sale_qty' =&gt; 1,
    'use_config_min_sale_qty' =&gt; 0,
    'max_sale_qty' =&gt; 10,
    'use_config_max_sale_qty' =&gt; 0,
    'is_qty_decimal' =&gt; 0,
    'backorders' =&gt; 1,
    'use_config_backorders' =&gt; 0,
    'notify_stock_qty' =&gt; 10,
    'use_config_notify_stock_qty' =&gt; 0
);

$result = $client-&gt;call(
    $session,
    'product_stock.update',
    array(
        $productId,
        $stockItemData
    )
);</pre>
		</div>
</div></div>

<h5><a name="cataloginventory_stock_item.update-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 
$sessionId = $proxy-&gt;login('apiUser', 'apiKey'); 
 
$result = $proxy-&gt;catalogInventoryStockItemUpdate($sessionId, 1, array(
'qty' =&gt; '49', 
'is_in_stock' =&gt; 1
));

var_dump($result);</pre>
		</div>
</div></div>



<h5><a name="cataloginventory_stock_item.update-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey')); 
 
$result = $proxy-&gt;catalogInventoryStockItemUpdate((object)array('sessionId' =&gt; $sessionId-&gt;result, 'productId' =&gt; '1', 'data' =&gt; array(
'qty' =&gt; '49', 
'is_in_stock' =&gt; 1
)));   

var_dump($result-&gt;result);</pre>
		</div>
</div></div>

<?php include(__ROOT__ . 'footer.php'); ?>
